package cn.ilikes.tools.hbase.jpa.clients.datahander;

import org.slf4j.Logger;

import cn.ilikes.tools.hbase.jpa.JPAHbasePersistenUnitEnv;
import cn.ilikes.tools.hbase.jpa.clients.AbClient;
import cn.ilikes.tools.hbase.jpa.clients.JPAHBaseClientsRuntimeException;
import cn.ilikes.tools.hbase.jpa.clients.datasource.DataSource;
import cn.ilikes.tools.logs.Loggerfactory;

public abstract class AbDataHander extends DataHanderBaseImple implements DataHander {

	private Logger logger = Loggerfactory.instance(AbDataHander.class);

	private DataSource dataSource;

	public AbDataHander(DataSource dataSource, JPAHbasePersistenUnitEnv hbasePersistenUnitEnv) {
		super(hbasePersistenUnitEnv);
		this.dataSource = dataSource;
	}

	public <V> V getDataSource() {
		return (V) dataSource;
	}

	@Override
	public void flush() {
		Loggerfactory.info(logger, "=================> AbDataHander  flush  this not  work");
		//		throw new JPAHBaseClientsRuntimeException("this not  work ");

	}

	@Override
	public boolean isOpen() {
		Loggerfactory.info(logger, "=================> AbDataHander  isOpen   this not  work ;defult true");
		return true;
	}

}